{% extends "admin/base.html" %}

{% block htmlTitle %}编辑文章{% endblock %}

{% block head %}{% endblock %}

{% block pageTitle %}编辑文章{% endblock %}

{% block content %}
{% include "admin/_flash.html" %}
<form action="" method="post">
  <div class="mdui-textfield">
    <label class="mdui-textfield-label">标题</label>
    <input name="title" class="mdui-textfield-input" type="text" value="{{ article.title }}" />
  </div>
  <div class="mdui-textfield">
    <label class="mdui-textfield-label">摘要</label>
    <textarea name="excerpt" class="mdui-textfield-input" type="text" >{{ article.excerpt }}</textarea>
  </div>
  <div class="mdui-textfield">
    <label class="mdui-textfield-label">内容(Markdown)</label>
    <textarea name="content" class="mdui-textfield-input" type="text" rows="10">{{ article.content_md }}</textarea>
  </div>
  <div class="mdui-textfield">
    <label class="mdui-textfield-label">分类</label>
    <input name="category" class="mdui-textfield-input" type="text" value="{{ article.category }}" />
  </div>
  <div class="mdui-textfield">
    <label class="mdui-textfield-label">标签(半角逗号隔开)</label>
    <input name="tag" class="mdui-textfield-input" type="text" value="{{ ','.join(article.tag) }}" />
  </div>
  <button type="submit"class="mdui-btn mdui-btn-raised mdui-ripple mdui-color-theme-accent">提交</button>
</form>
<br>
<a href="{{ url_for('admin.article_delete', article_id=article.id) }}" class="mdui-btn mdui-btn-raised mdui-ripple mdui-color-theme-accent">删除文章</a>
{% endblock %}